home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / renderFlagsWindow.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  13.3 KB  |  500 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. global proc setRenderFlagsWindow( )
  18. //
  19. //    This procedure sets the mode the Render Flags
  20. //    window is in.  To add new modes, simply add new
  21. //    itemFilters, a menu item to the optionMenu
  22. //    that controls this itemFilter, and new cases
  23. //    in the following procedure to set the channels
  24. //    the channel box is showing, and the filter the
  25. //    outliner is using for the objects it's showing
  26. //    in the Render Flags outliner.
  27. {
  28.     //    Get the mode the user is currently in
  29.     //    in order to switch the contents of the
  30.     //    render flags window to the appropriate
  31.     //    filter mode
  32.     //
  33.     string $mode = `optionMenu -q -v rndFlagsShowMenu`;
  34.     switch( $mode ) {
  35.         case "Objects":
  36.             outlinerEditor -e -filter geomFilter rndFlagsOutliner; 
  37.             channelBox -e -fal {"visibility",
  38.                                 "doubleSided",
  39.                                 "opposite",
  40.                                 "smoothShading",
  41.                                 "motionBlur",
  42.                                 "visibleInReflections",
  43.                                 "visibleInRefractions",
  44.                                 "castsShadows",
  45.                                 "receiveShadows",
  46.                                 "geometryAntialiasingOverride",
  47.                                 "antialiasingLevel",
  48.                                 "shadingSamplesOverride",
  49.                                 "shadingSamples",
  50.                                 "maxShadingSamples",
  51.                                 "volumeSamples",
  52.                                 "volumeSamplesOverride",
  53.                                 "maxVisibilitySamples",
  54.                                 "maxVisibilitySamplesOverride",
  55.                                 "primaryVisibility",
  56.                                 "boundingBoxScaleX",
  57.                                 "boundingBoxScaleY",
  58.                                 "boundingBoxScaleZ",
  59.                                 "featureDisplacement",
  60.                                 "initialSampleRate",
  61.                                 "extraSampleRate",
  62.                                 "textureThreshold",
  63.                                 "normalThreshold",
  64.                                 "fixTextureWarp",
  65.                                 "gridDivisionPerSpanU",
  66.                                 "gridDivisionPerSpanV"} 
  67.                 rndFlagsChannelBox;
  68.             break;
  69.  
  70.         case "Lights":
  71.             outlinerEditor -e -filter lightFilter rndFlagsOutliner; 
  72.             channelBox -e -fal {"intensity", 
  73.                                 "colorR", 
  74.                                 "colorG", 
  75.                                 "colorB", 
  76.                                 "coneAngle",
  77.                                 "decayRate",
  78.                                 "useDecayRegions", 
  79.                                 "emitDiffuse",
  80.                                 "emitSpecular",
  81.                                 "useRayTraceShadows", 
  82.                                 "shadowRays",
  83.                                 "useDepthMapShadows", 
  84.                                 "shadColorR", 
  85.                                 "shadColorG", 
  86.                                 "shadColorB"} 
  87.                 rndFlagsChannelBox;
  88.             break;
  89.  
  90.         case "Dynamics":
  91.             outlinerEditor -e -filter dynFilter rndFlagsOutliner; 
  92.             channelBox -e -fal {"visibility", 
  93.                                 "dynamicsWeight", 
  94.                                 "magnitude", 
  95.                                 "attenuation", 
  96.                                 "maxDistance", 
  97.                                 "applyPerVertex", 
  98.                                 "rate", 
  99.                                 "betterIllumination", 
  100.                                 "surfaceShading", 
  101.                                 "threshold", 
  102.                                 "radius", 
  103.                                 "radius0", 
  104.                                 "radius1", 
  105.                                 "tailSize", 
  106.                                 "motionBlur",
  107.                                 "visibleInReflections",
  108.                                 "visibleInRefractions",
  109.                                 "castsShadows",
  110.                                 "receiveShadows",
  111.                                 "geometryAntialiasingOverride",
  112.                                 "antialiasingLevel",
  113.                                 "shadingSamplesOverride",
  114.                                 "shadingSamples",
  115.                                 "maxShadingSamples",
  116.                                 "volumeSamples",
  117.                                 "volumeSamplesOverride",
  118.                                 "maxVisibilitySamples",
  119.                                 "maxVisibilitySamplesOverride",
  120.                                 "primaryVisibility"} 
  121.                 rndFlagsChannelBox;
  122.             break;
  123.  
  124.         case "Cameras":
  125.             outlinerEditor -e -filter cameraFilter rndFlagsOutliner; 
  126.             channelBox -e -fal {"renderable", 
  127.                                 "focalLength", 
  128.                                 "nearClipPlane", 
  129.                                 "farClipPlane", 
  130.                                 "horizontalFilmAperture", 
  131.                                 "verticalFilmAperture", 
  132.                                 "horizontalFilmOffset", 
  133.                                 "verticalFilmOffset", 
  134.                                 "lensSqueezeRatio", 
  135.                                 "image", 
  136.                                 "mask", 
  137.                                 "depth", 
  138.                                 "backgroundColorR", 
  139.                                 "backgroundColorG", 
  140.                                 "backgroundColorB",
  141.                                 "size",
  142.                                 "offset",
  143.                                 "type",
  144.                                 "fit",
  145.                                 "displayMode",
  146.                                 "displayOnlyIfCurrent",
  147.                                 "lockedToCamera",
  148.                                 "geometryAntialiasingOverride",
  149.                                 "antialiasingLevel",
  150.                                 "shadingSamplesOverride",
  151.                                 "shadingSamples",
  152.                                 "maxShadingSamples"
  153.                                 } 
  154.                 rndFlagsChannelBox;
  155.             break;
  156.  
  157.         case "Materials":
  158.             outlinerEditor -e -filter materialFilter rndFlagsOutliner; 
  159.             channelBox -e -fal {"colorR", 
  160.                                 "colorG", 
  161.                                 "colorB", 
  162.                                 "transparencyR", 
  163.                                 "transparencyG", 
  164.                                 "transparencyB", 
  165.                                 "ambientColorR", 
  166.                                 "ambientColorG", 
  167.                                 "ambientColorB", 
  168.                                 "diffuse", 
  169.                                 "translucence",
  170.                                 "translucenceFocus",
  171.                                 "translucenceDepth",
  172.                                 "cosinePower", 
  173.                                 "eccentricity", 
  174.                                 "specularRollOff", 
  175.                                 "roughness", 
  176.                                 "highlightSize", 
  177.                                 "reflectivity", 
  178.                                 "specularColorR", 
  179.                                 "specularColorG", 
  180.                                 "specularColorB", 
  181.                                 "hideSource", 
  182.                                 "glowIntensity", 
  183.                                 "refractions", 
  184.                                 "refractiveIndex", 
  185.                                 "reflectionLimit", 
  186.                                 "refractionLimit",
  187.                                 "surfaceThickness",
  188.                                 "shadowAttenuation",
  189.                                 "lightAbsorbance",
  190.                                 "chromaticAberration",
  191.                                 "density", 
  192.                                 "fastDropOff", 
  193.                                 "useDistance", 
  194.                                 "useLayer", 
  195.                                 "useHeight", 
  196.                                 "noise", 
  197.                                 "noiseFreq", 
  198.                                 "noiseAspect",
  199.                                 "shadingMapColorR", 
  200.                                 "shadingMapColorG", 
  201.                                 "shadingMapColorB"
  202.                                  } 
  203.                 rndFlagsChannelBox;
  204.             break;
  205.  
  206.  
  207.         case "Textures":
  208.             outlinerEditor -e -filter textureFilter rndFlagsOutliner; 
  209.             channelBox -e -fal {"visibility", 
  210.                                 "repeatU", 
  211.                                 "repeatV", 
  212.                                 "rotateUV", 
  213.                                 "noiseU", 
  214.                                 "noiseV", 
  215.                                 "wrapU", 
  216.                                 "wrapV", 
  217.                                 "mirrorU", 
  218.                                 "mirrorV", 
  219.                                 "stagger", 
  220.                                 "coverageU", 
  221.                                 "coverageV", 
  222.                                 "rotateFrame", 
  223.                                 "translateFrameU", 
  224.                                 "translateFrameV", 
  225.                                 "colorGainR", 
  226.                                 "colorGainG", 
  227.                                 "colorGainB", 
  228.                                 "colorOffsetR", 
  229.                                 "colorOffsetG", 
  230.                                 "colorOffsetB", 
  231.                                 "defaultColorR", 
  232.                                 "defaultColorG", 
  233.                                 "defaultColorB", 
  234.                                 "alphaGain", 
  235.                                 "alphaOffset", 
  236.                                 "filter",
  237.                                 "filterOffset"} 
  238.                 rndFlagsChannelBox;
  239.             break;
  240.  
  241.         case "General":
  242.             outlinerEditor -e -filter globalRndFilter rndFlagsOutliner; 
  243.             channelBox -e -fal {"renderAll", 
  244.                                 "animation", 
  245.                                 "startFrame", 
  246.                                 "endFrame", 
  247.                                 "byFrameStep", 
  248.                                 "maximumMemory", 
  249.                                 "motionBlur", 
  250.                                 "width", 
  251.                                 "height", 
  252.                                 "edgeAntiAliasing", 
  253.                                 "useMultiPixelFilter", 
  254.                                 "shadingSamples", 
  255.                                 "maxShadingSamples", 
  256.                                 "volumeSamples", 
  257.                                 "particleSamples", 
  258.                                 "visibilitySamples", 
  259.                                 "maxVisibilitySamples", 
  260.                                 "enableRaytracing", 
  261.                                 "enableDepthMaps"} 
  262.                 rndFlagsChannelBox;
  263.             break;
  264.     }
  265. }
  266.  
  267. //
  268. //  Alias|Wavefront Script File
  269. //  MODIFY THIS AT YOUR OWN RISK
  270. //
  271. //  Creation Date:  15 April, 1997
  272. //  Author:         Luca Vezzadini
  273. //
  274. //  Procedure Name:
  275. //      renderFlagsWindow
  276. //
  277. //  Description:
  278. //      Creates a tab for the transform tools in the toolbox.
  279. //
  280. //  Input Arguments:
  281. //      The parent control that the tab will be created in.
  282. //
  283. //  Return Value:
  284. //      None.
  285. //
  286.  
  287. global proc renderFlagsWindow () 
  288. {
  289.     if (!`window -exists renderFlagsWindow`)
  290.     {
  291.         // Need to create the window
  292.         //
  293.         window
  294.             -w 400
  295.             -h 450
  296.             -menuBar true
  297.             -title "Rendering Flags"
  298.             -iconName "Render Flags"
  299.             renderFlagsWindow;
  300.  
  301.  
  302.         //    Adds support for the Context Sensitive Help Menu.
  303.         //
  304.         addContextHelpProc "renderFlagsWindow" "buildRenderFlagsContextHelpItems";
  305.         
  306.         doHelpMenu("renderFlagsWindow", "renderFlagsWindow");
  307.  
  308.         formLayout -nd 5 rndFlagsForm;
  309.  
  310.         columnLayout rndFlagsRow;
  311.             optionMenu -l "Show:" -cc "setRenderFlagsWindow" rndFlagsShowMenu;
  312.                 menuItem -l "Objects";
  313.                 menuItem -l "Lights";
  314.                 menuItem -l "Dynamics";
  315.                 menuItem -l "Cameras";
  316.                 menuItem -l "Textures";
  317.                 menuItem -l "Materials";
  318.                 menuItem -l "General";
  319.             setParent -m ..;
  320.         setParent ..;
  321.  
  322.         separator -style "in" rndFlagsSep1;
  323.  
  324.         if (!`itemFilter -exists geomFilter`) {
  325.             // create a filter for geometry objects
  326.             //
  327.             itemFilter 
  328.                 //-parent "renderFlagsWindow" 
  329.                 //-byType "geometryShape" geomFilter;
  330.                 -byType "surfaceShape" 
  331.                 -byType "renderSphere" 
  332.                 -byType "renderCone" 
  333.                     geomFilter;
  334.     
  335.             // create a filter for cameras
  336.             //
  337.             itemFilter 
  338.                 //-parent "renderFlagsWindow" 
  339.                 -byType "camera" 
  340.                 -byType "imagePlane" cameraFilter;
  341.     
  342.             // create a filter for dynamics
  343.             //
  344.             itemFilter 
  345.                 //-parent "renderFlagsWindow" 
  346.                 -byType "particle" 
  347.                 -byType "rigidBody" 
  348.                 -byType "field" dynFilter;
  349.     
  350.             // create a filter for lights
  351.             //
  352.             itemFilter 
  353.                 //-parent "renderFlagsWindow" 
  354.                 -byType "light" lightFilter;
  355.     
  356.             // create a filter for render globals
  357.             //
  358.             itemFilter 
  359.                 //-parent "renderFlagsWindow" 
  360.                 -byType "renderGlobals" 
  361.                 -byType "resolution" 
  362.                 -byType "renderQuality" globalRndFilter;
  363.     
  364.             // create a filter for textures
  365.             //
  366.             itemFilter 
  367.                 //-parent "renderFlagsWindow" 
  368.                 -byType "place3dTexture" 
  369.                 -byType "place2dTexture" 
  370.                 -byType "texture3d"
  371.                 -byType "texture2d"
  372.                 -byType "textureEnv" textureFilter;
  373.     
  374.     
  375.             // create a filter for materials
  376.             //
  377.             itemFilter 
  378.                 //-parent "renderFlagsWindow" 
  379.                 -byType "lambert" 
  380.                 -byType "lightFog" 
  381.                 -byType "useBackground"
  382.                 -byType "shadingMap" materialFilter;
  383.         }
  384.  
  385.         frameLayout 
  386.             -lv false 
  387.             -bs "in" -bv true 
  388.             -cll false -cl false 
  389.             rndFlagsFrame;
  390.  
  391.             formLayout rndFlagsControlForm;
  392.  
  393.                 // put an outliner in the window and attach it to the left.
  394.                 // This outliner reads from the "world" list, and outputs
  395.                 // its selected objects to the selected list
  396.                 //
  397.                 outlinerEditor
  398.                     -mainListConnection worldList
  399.                     -selectionConnection activeList
  400.                     -ignoreDagHierarchy true
  401.                     -filter geomFilter
  402.                     -showShapes true
  403.                     -showDagOnly false
  404.                     -highlightActive true
  405.                     -autoSelectNewObjects false
  406.                     rndFlagsOutliner;
  407.         
  408.                 // create a channelBox and put it on the right
  409.                 // hand side of the window.  Use the output of the outliner
  410.                 // as the input of the channelBox.
  411.                 //
  412.                 channelBox
  413.                     -fal {"visibility","doubleSided","opposite","smoothShading",
  414.                           "motionBlur","visibleInReflections","visibleInRefractions",
  415.                           "castsShadows", 
  416.                           "receiveShadows", 
  417.                           "geometryAntialiasingOverride", "antialiasingLevel",
  418.                           "shadingSamplesOverride", "shadingSamples", "maxShadingSamples",
  419.                           "volumeSamples", "volumeSamplesOverride",
  420.                           "maxVisibilitySamples", "maxVisibilitySamplesOverride",
  421.                           "bmv","primaryVisibility",
  422.                           "boundingBoxScaleX", "boundingBoxScaleY", "boundingBoxScaleZ",
  423.                           "featureDisplacement", "initialSampleRate", "extraSampleRate",
  424.                           "textureThreshold", "normalThreshold",
  425.                           "fixTextureWarp", "gridDivisionPerSpanU",    "gridDivisionPerSpanV" }
  426.                     -mainListConnection activeList
  427.                     -showTransforms false
  428.                     -longNames true
  429.                     -width 250
  430.                     rndFlagsChannelBox;
  431.  
  432.             setParent ..;
  433.         setParent ..;
  434.  
  435.         formLayout -e
  436.             -af rndFlagsOutliner top 0 
  437.             -af rndFlagsOutliner left 0 
  438.             -af rndFlagsOutliner bottom 0 
  439.             -ac rndFlagsOutliner right 0 rndFlagsChannelBox
  440.  
  441.             -af rndFlagsChannelBox top 0
  442.             -af rndFlagsChannelBox right 0 
  443.             -af rndFlagsChannelBox bottom 0
  444.             -an rndFlagsChannelBox left
  445.             rndFlagsControlForm;
  446.  
  447.         separator -style "in" rndFlagsSep2;
  448.  
  449.         button -l "Close" 
  450.             -c "deleteUI renderFlagsWindow" 
  451.             -height 26
  452.             rndFlagsDelBtn;
  453.  
  454.         // Do all the attachments
  455.         //
  456.         formLayout -e
  457.             -af rndFlagsRow top 0
  458.             -af rndFlagsRow left 0
  459.             -an rndFlagsRow bottom
  460.  
  461.             -ac rndFlagsFrame top 0 rndFlagsRow
  462.             -af rndFlagsFrame left 0
  463.             -af rndFlagsFrame right 0
  464.             -ac rndFlagsFrame bottom 5 rndFlagsDelBtn
  465.  
  466.             -an rndFlagsDelBtn top
  467.             -af rndFlagsDelBtn left 5
  468.             -af rndFlagsDelBtn right 5
  469.             -af rndFlagsDelBtn bottom 5
  470.             rndFlagsForm;
  471.     }
  472.  
  473.     // Show the window
  474.     //
  475.     showWindow renderFlagsWindow;
  476. }
  477.  
  478. //////////////////////////////////////////////////////////////////////
  479. //
  480. //  Procedure Name:
  481. //      buildRenderFlagsContextHelpItems
  482. //
  483. //  Description:
  484. //        Build context sensitive menu items for the render flags.  
  485. //        
  486. //  Input Arguments:
  487. //        $nameRoot - name to use as the root of all item names
  488. //        $menuParent - the name of the parent of this menu
  489. //
  490. //  Return Value:
  491. //      None
  492. //
  493. global proc buildRenderFlagsContextHelpItems(string $nameRoot, string $menuParent)
  494. {
  495.     menuItem -label "Help on Render Flags..."
  496.         -enableCommandRepeat false
  497.         -command "showHelp RenderingFlags";
  498. }
  499.  
  500.